package net.hn.hnms.biz.energy.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.energy.request.WaterUseAnalysisReq;
import net.hn.hnms.biz.energy.service.WaterUseAnalysisService;
import net.hn.hnms.biz.energy.vo.WaterUseAnalysisVo;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 刘昊
 * @date 2024-03-01 9:02
 */
@Api(value = "用水分析", tags = {"用水分析"})
@RestController
@RequestMapping("/water/useAnalysis")
public class WaterUseAnalysisController {

    @Autowired
    WaterUseAnalysisService service;

    @ApiOperation("用水同比分析")
    @GetMapping("/yearAnalysis")
    @AutoSetMineCode
    @Deprecated
    public R<List<WaterUseAnalysisVo>> yearAnalysis(WaterUseAnalysisReq waterUseAnalysisReq) {

        List<WaterUseAnalysisVo> result = service.getYearAnalysis(waterUseAnalysisReq);
        return R.ok(result) ;
    }

    @ApiOperation("用水环比分析")
    @GetMapping("/monthAnalysis")
    @AutoSetMineCode
    @Deprecated
    public R<List<WaterUseAnalysisVo>> monthAnalysis(WaterUseAnalysisReq waterUseAnalysisReq) {

        List<WaterUseAnalysisVo> result = service.getMonthAnalysis(waterUseAnalysisReq);
        return R.ok(result);
    }

    @ApiOperation("用水同比分析")
    @GetMapping("/getYearOnYearChange")
    public R<List<WaterUseAnalysisVo>> yearOnYearChange(WaterUseAnalysisReq waterUseAnalysisReq) {

        List<WaterUseAnalysisVo> result = service.getYearOnYearChange(waterUseAnalysisReq);
        return R.ok(result);
    }

    @ApiOperation("用水环比分析")
    @GetMapping("/getMonthOnMonthChange")
    public R<List<WaterUseAnalysisVo>> monthOnMonthChange(WaterUseAnalysisReq waterUseAnalysisReq) {

        List<WaterUseAnalysisVo> result = service.getMonthOnMonthChange(waterUseAnalysisReq);
        return R.ok(result);
    }
}
